<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>上下居中</title>
<style>
div{
	width: 400px;
	height: 400px;
	position: relative;
	border: 1px solid #465468;
}
img{
	position: absolute;
	margin: auto;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
}

</style>
</head>
<body>
	<div>
		<img src="https://sf3-scmcdn2-tos.pstatp.com/xitu_juejin_web/img/logo.a7995ad.svg">
	</div>
</body>
</html>